<?php

use yii\helpers\Html;
use eric\widgets\GridView;
use eric\widgets\Modal;

/* @var $this yii\web\View */
/* @var $searchModel app\models\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', 'Users');
$this->params['breadcrumbs'][] = $this->title;
?>
<!--BEGIN HEADER-->
<div class="section-header">
    <h3 class="text-standard"><i class="fa fa-fw fa-arrow-circle-right text-gray-light"></i> <?=$this->title?> <small><?=$this->subTitle?></small></h3>
</div>
<!--END HEADER-->
<!--BEGIN BODY-->
<div class="section-body">
    <div class="user-index">
        <p>
            <?= Html::a(Yii::t('app', 'Create {modelClass}', [
                'modelClass' => 'User',
            ]), ['create?partial=1'], [
                'data-toggle' => "modal",
                'data-target' => "#user_modal",
                'class' => 'btn btn-support1'
            ]) ?>
        </p>

        <?= GridView::widget([
            'dataProvider' => $dataProvider,
            'filterModel' => $searchModel,
            'options' => [
                'id' => 'user_grid',
            ],
            'columns' => [
                'userid',
                'username',
                'name',
                //'age',
                //'gender',
                // 'certno',
                // 'password',
                'salt',
                // 'create_timestamp:datetime',
//                 'modify_timestamp:datetime',
//                 'modify_userid',

                [
                    'class' => 'eric\widgets\ActionColumn',
                    'modalId' => 'user_modal'
                ],
            ],
        ]); ?>
    </div>
</div>
<!--END BODY-->
<?php
    Modal::begin([
        'options' => [
            'id' => 'user_modal'
        ],
        'size' => Modal::SIZE_LARGE,
        'header' => '用户面板',
    ]);
    Modal::end();
?>